package org.zxp.javacheck.keywords.asserttest;

import org.junit.Assert;
import org.junit.Test;

/**
 * @program: effectiveJava
 * @description: 断言测试
 * @author: X-Pacific zhang
 * @create: 2019-08-20 11:41
 **/
public class AssertTest {
    /**
     * java 自带断言 vm参数要加 -ea
     * @param args
     */
    public static void main(String[] args){
        int a = 1;
        int b = 2;
        assert a>b;
    }

    /**
     *junit中的断言使用
     * Spring中也有org.springframework.util.Assert断言工具类
     */
    @Test
    public void testAssert(){
        Assert.assertNotNull(new Object());
    }
}
